|
| Contents | |
| About This Extension |
The Auto Disengage extension provides features to help alleviate the conflicts that may occur in some system configurations when the Beatnik Player and other audio players are being used together in the same Web site. Along with the ability to have the Beatnik Player automatically release the system's audio device when the player is not in use by the sonified site, the extension also provides a way to automatically force the player to release the audio device when the user clicks on a link to any type of media file that is not supported by the Beatnik Player (such as a streaming Real Audio file).
On some Windows systems, limitations in the installed sound hardware, the software drivers for the sound hardware, or the operating system's audio architecture may result in a situation where the Beatnik Player cannot play audio at the same time as other media players that wish to play audio. Typically, with these systems only one application can use the system's audio services at a time. This limitation may often result in the undesirable situation where sonification of a Web site using the Beatnik Player prevents links to other media on the Web site from working correctly.
If the Beatnik Player is using the system's audio device for the site's sonification at the time that the user clicks on a link to a RealAudio file, for example, then the RealPlayer may not be able to play the file that is being linked to, since the Beatnik Player may still be holding on to the audio device - even if the Beatnik-sonified window that launched the RealPlayer is no longer in the foreground.
To address this problem, Beatnik went to great lengths to develop the Audio Device Contention Manager (ADCM) system for the Beatnik Player 2.1. This system manages the device contention problem and very effectively handles many common cases where the Beatnik Player might, otherwise, contend with other media players for the audio device.
While the ADCM is a great system and does a really good job of avoiding these conflicts, it was only introduced at version 2.1 of the Beatnik Player, and there is still quite a large installed base of older versions out there. Unless you're willing to make your sonified content require version 2.1 as a minimum version, you will still be saddled with this issue. So, in order to provide some level of relief when an older version of the player is installed in the user's browser, the Auto Disengage extension has been developed.
The Auto Disengage extension does the best that it can to alleviate the audio device contention issue, even with the limited options available to it. The following three mechanisms are involved...
The key way that the Auto Disengage extension increases the likelihood of other media players being able to use the system's audio device is by reducing, to a bare minimum, the amount of time that the Beatnik Player is using the audio device. Rather than having the player hold onto the audio device all the time that it is loaded, the Auto Disengage extension instructs the player (using the Music.engageAudio static method) when the audio device is not needed.
A detection mechanism within the extension recognizes when there is no audio activity within a sonified document, and can then initiate the auto disengage process. A document is considered to have no audio activity when the audible instance property for every Music Object instance in the document is set to false. If the audible property for any instance is set to true, then the document is considered to still have audio activity.
The API for customizing the behavior of the auto disengage mechanism includes the Music.autoDisengageDelay and Music.autoDisengageEnabled static properties.
Because the audio engine could become disengaged as a result of the auto disengage mechanism (see Auto Disengage When No Audio Activity above) or the link interception mechanism (see Media File Link Interception below), there needs to also be some mechanism for eventually re-engaging the audio engine - otherwise the Beatnik-sonified content could be rendered permanently mute while the user continues to browse the sonified site in silence.
The auto engage mechanism, which addresses this need, contains a detection mechanism that recognizes when any Music Object instance becomes audible within a sonified document, and attempts to then re-engage the audio engine. If the attempt to re-engage the audio engine fails, then the auto engage mechanism will be triggered once again the next time that a Music Object instance becomes audible. A Music Object instance is considered to become audible when the value of its audible instance property changes from false to true.
The trigger mode for the auto engage mechanism can be customized by setting the Music.autoEngageMode static property. The behavior of the auto engage mechanism is also influenced by the value of the Music.mediaLinkShutoutTime static property.
On systems that are incapable of mixing audio from multiple applications, a Beatnik-sonified Web site that has a "soundtrack" throughout (implemented in a persistent frame) could create problems if the site also has links to media files that are handled by other media players. If these other media players also need to use the system's audio device, then the sonification of the Web site could prevent such media players from being able to play audio.
A classic example would be a sonified Web site that also has links to RealAudio files. On systems that cannot mix, the RealPlayer may not be able to play a RealAudio stream that is linked to from such a site, because the sonification may cause the Beatnik Player to hold onto the system's audio device.
The link interception mechanism provides a way of automatically intercepting links to media file types that are known by the Auto Disengage extension (see the section Built-in Media File Extensions), so that these links can disengage the audio engine when clicked, thereby giving the other media player an opportunity to grab the system's audio device for its own purposes.
Beyond merely disengaging the audio engine, these media link interceptors can also shut out the auto engage mechanism for a specified period of time (see the Music.mediaLinkShutoutTime static property). Because it may sometimes take certain media player applications several seconds to load up and start playing the file that is being linked to, this shutout mechanism helps to protect against the auto engage mechanism (see Auto Engage on Audio Activity above) re-engaging the audio engine while the media player is still loading (which could, otherwise, prevent it from being able to use the audio device).
The API for customizing the behavior of the media link interception mechanism includes the Music.addMediaFileExtensions and Music.mediaLinkClicked static methods, as well as the Music.mediaLinkInterception, Music.mediaLinkShutoutTime, and Music.mediaLinksNoOnClicks static properties.
The Auto Disengage extension contains a built-in default set of file extensions for media file types that are supported by other media players that may contend for the audio device on systems that are not capable of mixing audio from multiple applications. This built-in set cannot anticipate new file types that may be supported by various media players in future. The built-in set may also not cover file types that are supported by lesser known media players.
The table below lists all the media file type extensions that are built into the Auto Disengage extension...
|
If you are developing Beatnik-sonified content that may contain links to audio or video files (or any other types of media files) that are not covered by this built-in set of file extensions, and the media player(s) that support these file types are likely to need the system's audio device, then the Music.addMediaFileExtensions method provides an easy way to register the file extensions for these media file types.
As mentioned earlier, versions 2.1 and higher of the Beatnik Player incorporate a sophisticated and well thought-out system for effectively managing the audio device contention issue: the Audio Device Contention Manager (ADCM). Both the Auto Disengage extension and the ADCM have been designed to be able to work together. They do not work at odds with each other - they are cooperative.
The primary way that the Auto Disengage extension tries to alleviate device contention is to manage the engaged state of the audio engine through the Music.engageAudio static method. It is because of the improved behavior of the Music.engageAudio method (in Beatnik Player versions 2.1 and higher) that the Auto Disengage extension and the ADCM can actually work together. For more information, consult the section New Behavior for the Music.engageAudio Method.
Because of sensible default values for the various static properties of the Auto Disengage extension, no customization may be required in many cases in order to gain the benefits of using the extension. Often, all that will be required is to merely source the extension into sonified documents, as follows...
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT SRC="music-object-x-disengage.js"></SCRIPT>
<SCRIPT LANGUAGE=JavaScript><!-- //
bgMusic = new Music ();
bgMusic.magicEmbed (
'SRC="music/story-time.rmf" ' +
'WIDTH=0 HEIGHT=0 HIDDEN ' +
'AUTOSTART=TRUE LOOP=TRUE'
);
// --></SCRIPT>
<P><B>Streaming Short Stories</B></P>
<A HREF="pennies.ra">A Pocketful of Pennies</A><BR>
<A HREF="shame.ra">The Shame of Felix Humphreys</A><BR>
<A HREF="middle-life.ra">Journey Into the Middle of One's Life</A><BR>
<A HREF="tears.ra">Crying Glass Tears</A><BR>
<A HREF="apirations.ra">Aspirations Run Dry</A><BR>
|
Because of significant differences between player versions earlier than 2.1, and player versions 2.1 and higher, content that uses the Auto Disengage extension will behave somewhat differently depending on the version of the player that is installed in a user's browser.
With player versions earlier than 2.1, the Music.engageAudio static method always sets the global engaged state of the audio engine. Consequently, different sonified windows that are using the Auto Disengage extension and that do not have any knowledge of each other could "trample" on each other when engaging or disengaging the audio engine. For example, one window might think that there is no audio activity, simply because all of the Music Object instances that it knows about are in a stopped state. The Auto Disengage extension, operating within this window, may then disengage the audio engine while there is still audio activity in another sonified window - arguably an inappropriate behavior.
In player versions 2.1 and higher, the whole system for alleviating audio device contentions ensures a much better user experience on systems that are not capable of mixing audio from multiple applications. Specifically, it is because of the improved behavior of the Music.engageAudio method in these versions that the Auto Disengage extension can be used in multiple windows in a cooperative manner, so that the audio engine will only become disengaged if there is no audio activity in all sonified windows. For more information, consult the section New Behavior for the Music.engageAudio Method.
With the initial release of Netscape 6, it was discovered that this browser had a significant issue that could cause the automatic attachment of handlers to HTML elements, using JavaScript, to interfere with other aspects of the proper functioning of HTML pages.
The Auto Disengage extension achieves its interception of media file links by attaching handlers to the ONCLICK events of links to any media file types that it knows about (see the Music.addMediaFileExtensions static method). To prevent the Auto Disengage extension from potentially crippling pages when they are browsed in Netscape 6, the interception of media file links is disabled by default for Netscape 6.
The Music.mediaLinksNoOnClicks static property is offered as a way of extending the link interception behavior to Netscape 6 as well. This property needs to be explicitly set to true in order for media link interception to be active in Netscape 6, and this should only be done if you are absolutely certain that the media file links to which the Auto Disengage extension would add interceptors don't already have existing ONCLICK event handlers in the HTML code.
| What's New in the Latest Version |
There is a dedicated version history for this extension, where you will be able to find out about the new features and possible issues with the most recent version. The version history for this extension is independent of the version history for the core Music Object API.
| Getting This Extension |
To get the "music-object-x-disengage.js" JavaScript file that implements this extension, simply right-click on this link (click-and-hold for Mac users). Then, from the menu that pops up, select the 'Save Link As...' or 'Save Target As...' option and save the file as "music-object-x-disengage.js" into an appropriate folder of the local copy of your Web site.
In case you have problems saving the file using the above link, the "music-object-x-disengage.js" file can also be found inside the documentation's "javascript" folder, along with the "music-object.js" file.
| Dependencies |
In order to use this extension, the following JavaScript file(s) must first be sourced in...
For more information on using extensions, consult the section About Music Object Extensions.
| Reference |
| |||||||||||||||||||||||
| Static Methods |
| Music.addMediaFileExtensions |
|
The Music.addMediaFileExtensions static method lets you register additional file extensions for media file types that are not handled by the Beatnik Player.
| Music.addMediaFileExtensions ( AudioFileExtensionsSTR ) |
The Auto Disengage extension contains a built-in default set of file extensions for media file types that are supported by other media players that may contend for the audio device (see the section Built-in Media File Extensions). If you are developing Beatnik-sonified content that may contain links to media file types that are not covered by this built-in set, and the media player(s) that support these file types are likely to need the system's audio device, then the Music.addMediaFileExtensions method provides an easy way to register the file extensions for these media file types.
The Auto Disengage extension's set of media file extensions is only used in determining which links need to automatically have interceptors added to them, so that the auto disengage process can be initiated when the user clicks these links and so that the media player that will handle the file that is being linked to will stand a good chance of getting to use the system's audio device.
So, it is not really necessary to use the Music.addMediaFileExtensions method to register all the media file extensions that are supported by a particular media player you may be using to handle certain links. It is only necessary to register the file extensions for the media file types that you will be linking to. In some cases, this may be only a small subset of the media file extensions that are handled by a player.
Of course, there is no danger in registering additional redundant media file extensions. In fact, it could even be useful - especially if there is some likelihood that you may choose to use those other media types at some point in the future, or if there is a chance that some other developers may later update the sonified pages and choose to use those other media types.
To illustrate the process for registering additional media file extensions, let's take a look at a simple example. Let's say we were creating a Beatnik-sonified page that was to use the hypothetical Mystery X Player from the hypothetical company Mystery X Software Technologies Inc. Now, let's say that the Mystery X Player supported the playback of several media formats developed by Mystery X Software Technologies Inc., including the original Mystery file (.mys), the Mystery X Format (.mxf), the Mystery X Playlist (.mxp), and the revolutionary new Mystery X Generation II Format (.mys2).
Now, if our Beatnik-sonified page were only to contain links to files of the original Mystery file format (.mys), then the code may look as follows...
<SCRIPT SRC="music-object.js"></SCRIPT> <SCRIPT SRC="music-object-x-disengage.js"></SCRIPT> <SCRIPT LANGUAGE=JavaScript><!-- // Music.addMediaFileExtensions ('Mystery X Player |mys|'); bgMusic = new Music (); bgMusic.magicEmbed ( 'SRC="music/mystery-theme.rmf" ' + 'WIDTH=0 HEIGHT=0 HIDDEN ' + 'AUTOSTART=TRUE LOOP=TRUE' ); // --></SCRIPT> <A HREF="caught-in-sail.mys">Caught in the Sail</A><BR> <A HREF="helix.mys">Helix in my Pocket</A><BR> <A HREF="substance.mys">Men of Liquid Substance</A><BR> <A HREF="night-out.mys">Night Out on the Ghost Town</A><BR> <A HREF="arguing.mys">In the Mood for Arguing</A><BR> <A HREF="acropolis.mys">Acropolis Now</A><BR> <A HREF="the-days.mys">Them Thar was the Days</A><BR> <A HREF="decency.mys">Public Decency</A><BR> |
In the above sample code listing, the highlighted code indicates the code needed in order to use the Auto Disengage extension to make links to ".mys" files automatically initiate the auto disengage process when clicked. Now, as stated earlier, it is not necessary to register the file extensions for only those media file types you will be linking to in a page. It is perfectly valid to register further file extensions for file types that may be used at a future date.
So, in order to register all of the file extensions that are handled by the Mystery X Player, the modified code would look as follows...
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT SRC="music-object-x-disengage.js"></SCRIPT>
<SCRIPT LANGUAGE=JavaScript><!-- //
Music.addMediaFileExtensions ('Mystery X Player |mys|mxf|mxp|mys2|');
bgMusic = new Music ();
bgMusic.magicEmbed (
'SRC="music/mystery-theme.rmf" ' +
'WIDTH=0 HEIGHT=0 HIDDEN ' +
'AUTOSTART=TRUE LOOP=TRUE'
);
// --></SCRIPT>
<A HREF="caught-in-sail.mys">Caught in the Sail</A><BR>
<A HREF="helix.mys">Helix in my Pocket</A><BR>
<A HREF="substance.mys">Men of Liquid Substance</A><BR>
<A HREF="night-out.mys">Night Out on the Ghost Town</A><BR>
<A HREF="arguing.mys">In the Mood for Arguing</A><BR>
<A HREF="acropolis.mys">Acropolis Now</A><BR>
<A HREF="the-days.mys">Them Thar was the Days</A><BR>
<A HREF="decency.mys">Public Decency</A><BR>
|
This time, the highlighted code indicates the code that was added in order to register the additional ".mxf", ".mxp", and ".mys2" file extensions.
In this particular example, there are no links to any files of the other formats supported by the Mystery X Player. However, this sonified document could be safely handed off to another person who has no understanding of the sonification or the Auto Disengage extension, and this person could add new links to files of the other Mystery X Player formats without having to worry about the page ceasing to function correctly.
In order to register additional file extensions that are not built into the Auto Disengage extension, these file extensions must be specified inside the AudioFileExtensionsSTR parameter. When constructing a valid value for this parameter, the following simple rules should be observed...
File extensions are not case-sensitive. So, for example, the statement...
Music.addMediaFileExtensions ('|mys|'); |
...has the same effect as the statement...
Music.addMediaFileExtensions ('|MYS|'); |
Each file extension must be enclosed with a pipe character ("|") on either side of it. The following two examples contrast the incorrect way of enclosing file extensions with the correct way.
| INCORRECT |
Music.addMediaFileExtensions ('mys'); |
| CORRECT |
Music.addMediaFileExtensions ('|mys|'); |
| INCORRECT |
Music.addMediaFileExtensions ('mys|mxf|mxp|mys2'); |
| CORRECT |
Music.addMediaFileExtensions ('|mys|mxf|mxp|mys2|'); |
Notice in the second example how it is acceptable for consecutively listed file extensions to share adjacent pipe characters. Sharing pipe characters is perfectly valid, since it does not break the rule that each file extension should be enclosed in pipe characters.
There must be no other characters (such as spaces) between a file extension's enclosing pipe characters and the file extension itself. The following example contrasts an incorrect way of registering file extensions with the correct way...
| INCORRECT |
Music.addMediaFileExtensions ('| mys | mxf | mxp | mys2 |'); |
| CORRECT |
Music.addMediaFileExtensions ('|mys|mxf|mxp|mys2|'); |
File extensions must not be prefixed with a period character ("."). Even though file extensions may often appear prefixed with a period character in documentation, there must be no period prefixed when using the Music.addMediaFileExtensions method. The following example contrasts an incorrect way of registering file extensions with the correct way...
| INCORRECT |
Music.addMediaFileExtensions ('|.mys|.mxf|.mxp|.mys2|'); |
| CORRECT |
Music.addMediaFileExtensions ('|mys|mxf|mxp|mys2|'); |
Additional text that describes the file extensions being registered is permitted. This essentially allows for comments within the value of the AudioFileExtensionsSTR parameter, making it easier to make sense of your code later and making it easier to edit - especially if one call to the Music.addMediaFileExtensions method is being used to register the file extensions for multiple media players. Additional comment text will not be regarded as a file extension and will simply be ignored.
In the following example, file extensions for the Mystery X Player as well as the Enigma Y Player are being registered in a single statement...
Music.addMediaFileExtensions ( 'Mystery X Player |mys|mxf|mxp|mys2| Enigma Y Player |enig|eff|e2f|' ); |
| Music.mediaLinkClicked |
|
The Music.mediaLinkClicked static method lets you explicitly register that a link to a media file has been clicked.
| Music.mediaLinkClicked ( ) |
In most cases it will not be necessary to use this method. On systems that are considered incapable of mixing audio from multiple applications, the Auto Disengage extension will automatically add interceptors to media file links at the time that the document completes loading in. These interceptors are only added on the condition that the Music.mediaLinkInterception static property is set to true at the time that the document completes loading in, and the user is not using Netscape 6 (unless the Music.mediaLinksNoOnClicks static property is set to true).
The Music.mediaLinkClicked method provides an alternative to allowing the Auto Disengage extension to automatically intercept media file links, and there are, in fact, a number of situations where it may be more desirable to use this method...
Because of a bug in Netscape 6, the Auto Disengage extension will, by default, not add interceptors to media file links when the user is browsing with Netscape 6. If you want to make use of the link interception feature and you're certain that none of the links have existing ONCLICK event handlers in the HTML code, then you can add a statement in the code to set the value of the Music.mediaLinksNoOnClicks static property to true.
However, if any of these links do have existing ONCLICK event handlers in the HTML code, then the best approach to take is to add a statement in the code to set the value of the Music.mediaLinkInterception static property to false and then add a call to the Music.mediaLinkClicked method to the ONCLICK event handler in the HTML code for each of the media file links.
The Auto Disengage extension contains a built-in default set of file extensions for media file types that are supported by other media players that may contend for the audio device on systems that are not capable of mixing audio from multiple applications. This built-in set cannot anticipate new file types that may be supported by various media players in future. The built-in set may also not cover file types that are supported by lesser known media players.
One way to get around this, when using the link interception feature, is to add a statement in the code to call the Music.addMediaFileExtensions in order to register the additional file extensions for media files that you may be linking to in the document. However, another way that this can be handled is to simply add a call to the Music.mediaLinkClicked method to the ONCLICK event handler in the HTML code for each of the links to media file types that are not known by the Auto Disengage extension. For handling just a few media file links, this may be a perfectly adequate approach.
If you wish to have complete control over which media file links get to initiate the auto disengage process, then you can opt to manually "wire" the desired links to the auto disengage behavior. In this event, you would add a statement in the code to set the value of the Music.mediaLinkInterception static property to false and then add a call to the Music.mediaLinkClicked method to the ONCLICK event handler in the HTML code for each of the media file links.
Among the benefits of using this approach are...
It is not necessary to maintain a separate "registry" of file extensions for the media files that will be linked to in your document.
Links to media files "fend" for themselves - so to speak - as far as the Auto Disengage extension is concerned, and the specific files being linked to can be changed without having to worry about the link possibly losing its auto disengage behavior if a different file format is chosen for the media file.
It may be more workable in cases where sonified pages that contain links to media files are being dynamically generated by a server. If the content of a document is very dynamic and the array of different media file types that it links to is unpredictable, then it may be easier for the server side code to just include a call to the Music.mediaLinkClicked method in the ONCLICK attribute of each media file link, rather than trying to dynamically forge a consolidated list of the media file extensions into a call to the Music.addMediaFileExtensions method, or trying to have a fixed "mega-list" that gets included.
Among the disadvantages of using this approach are...
With documents that contain a lot of links to media files, it could be tedious to add code to the ONCLICK attributes for these links.
The Music.mediaLinkInterception static property cannot be used as a master switch to disable the auto disengage behavior for links that have had manual calls to the Music.mediaLinkClicked method added.
There may be some cases where a sonified document contains links to cgi scripts that may actually resolve to media files. Often, a typical file URL for such a cgi script link may not even end in the file extension for the media type that the link will actually resolve to. So, as a result, the link interception mechanism within the Auto Disengage extension may not recognize these links as media file links and may, therefore, not add interceptors to them. The simple way to deal with this issue is to add a call to the Music.mediaLinkClicked method to the ONCLICK event handler in the HTML code for all such links.
In yet another scenario, a link within a sonified document may result in a new window opening up that contains audio-rich media. While such a link may not be recognized by the Auto Disengage extension as a link to a media file, per se, the link nevertheless has just about the same practical effect. The new window that is popped open, because it contains rich media that may desire to use the audio device, could be regarded as a "player" of a sort. Therefore, it would be desirable for this type of link to initiate the auto disengage when clicked.
Because interceptors will not be added to such links by the Auto Disengage extension, the simple remedy is to add a call to the Music.mediaLinkClicked method to the ONCLICK event handler in the HTML code for all such links.
The link interception mechanism of the Auto Disengage extension only considers links and does not look at other possible ways that media files can be "linked" to. For example, form buttons could be used in place of traditional links as a means of launching media players. For all such HTML elements, other than links, that may result in media players being launched, a call to the Music.mediaLinkClicked method may be added to the ONCLICK event handler in the HTML code for the elements.
Finally, in some rare cases, sonified documents may use another media player to create the graphical front-end. One such example would be an interface that is implemented using Macromedia's Flash Player, combined with sonification of that interface that is implemented using the Beatnik Player. Media players like the Flash Player, Apple's QuickTime Player, and others, quite often also allow links to be coded into the file formats for these players. Because such links are embedded into these files and cannot be scanned automatically using JavaScript, the Auto Disengage extension cannot automatically add interceptors to them.
Now, if these embedded links have the effect of opening up media-rich content in new browser windows, or of launching other media players to play back the files that are being linked to, then there is the potential for audio device contention problems. In order to deal with this, the same mechanism that allows the player that is being used for the graphical front-end to communicate to its host HTML document in order to achieve the Beatnik-sonification, can also be used in order to initiate the auto disengage process. Through whatever connection mechanism exists, the embedded media file link must be "wired" to the host HTML page so that the Music.mediaLinkClicked method is called when the link is clicked.
In the following rather simple example, the media file links already contained ONCLICK event handler code before the document was sonified. And, because of the bug in Netscape 6, the Auto Disengage extension would not automatically add link interceptors to these links when the document is browsed in Netscape 6. Now, because the link auto disengage behavior was considered desirable even for Netscape 6, it was decided to manually add a call to the Music.mediaLinkClicked method into the ONCLICK attribute for each of the links, as follows...
<SCRIPT SRC="music-object.js"></SCRIPT> <SCRIPT SRC="music-object-x-disengage.js"></SCRIPT> <SCRIPT LANGUAGE=JavaScript><!-- // Music.mediaLinkInterception = false; bgMusic = new Music (); bgMusic.magicEmbed ( 'SRC="music/story-time.rmf" ' + 'WIDTH=0 HEIGHT=0 HIDDEN ' + 'AUTOSTART=TRUE LOOP=TRUE' ); // --></SCRIPT> <P><B>Streaming Short Stories</B></P> <A HREF="pennies.ra" ONCLICK=" Music.mediaLinkClicked (); window.defaultStatus = 'LOADING... A Pocketful of Pennies'; return true " > A Pocketful of Pennies </A><BR> <A HREF="shame.ra" ONCLICK=" Music.mediaLinkClicked (); window.defaultStatus = 'LOADING... The Shame of Felix Humphreys'; return true " > The Shame of Felix Humphreys </A><BR> <A HREF="middle-life.ra" ONCLICK=" Music.mediaLinkClicked (); window.defaultStatus = 'LOADING... Journey Into the Middle of One\'s Life'; return true " > Journey Into the Middle of One's Life </A><BR> <A HREF="tears.ra" ONCLICK=" Music.mediaLinkClicked (); window.defaultStatus = 'LOADING... Crying Glass Tears'; return true " > Crying Glass Tears </A><BR> <A HREF="apirations.ra" ONCLICK=" Music.mediaLinkClicked (); window.defaultStatus = 'LOADING... Aspirations Run Dry'; return true " > Aspirations Run Dry </A><BR> |
| Static Properties |
| Music.autoDisengageDelay |
|
The Music.autoDisengageDelay static property is an integer variable, specifying for how long (measured in milliseconds) audio needs to be inactive in order for the auto disengage process to be initiated.
In certain sonified content, such as a case where the only Music Object instance that is playing is being used to play musical notes for user interface sonification and has its usage instance property set to "notes", the audio for the sonified document could switch back and forth quite rapidly between audible and inaudible states, as new notes are triggered and old notes die. For performance reasons, it may be desirable in such cases to limit the amount of rapid engaging and disengaging of the audio engine that occurs, so that the Auto Disengage extension does not actually hamper the user experience rather than improve it.
The Music.autoDisengageDelay property, therefore, provides a way to buffer against this rapid flip-flopping of the audio engine's engaged state that could occur with certain types of sonified content. So, for example, if this property was set to the value 5000, then the sonified document would have to remain inaudible for 5000 milliseconds (5 seconds) before the auto disengage process could be initiated. And, if something happened to result in the document becoming audible once again during this delay period, then the pending auto disengage process would be aborted.
| Music.autoDisengageEnabled |
|
The Music.autoDisengageEnabled static property is a boolean variable, acting as a master switch to either enable or disable the Auto Disengage extension.
When this property is set to true, then the Auto Disengage extension will be enabled. And when this property is set to false, then the Auto Disengage extension will be disabled. Being set to false at the time that the document loads in will not, in itself, cause media link interceptors to not be added. It is other factors, such as the values of the Music.mediaLinkInterception and Music.mediaLinksNoOnClicks static properties, that actually determine whether or not link interceptors are added.
If link interceptors have been added, however, a value of false for the Music.autoDisengageEnabled property will prevent those link interceptors from initiating the auto disengage process, and they will not perform any auto disengage action until such a time as the Music.autoDisengageEnabled property is set to true.
The Music.autoDisengageEnabled property provides a convenient way, while testing content, to compare the behavior of the content when the Auto Disengage extension is enabled to its behavior when the extension is disabled - without having to maintain separate documents. This is all the more helpful if your content is making use of the other customization options for this extension, in which case, maintaining separate versions of the content for comparison purposes could be a real nuisance.
| Music.autoEngageMode |
|
The Music.autoEngageMode static property is a string variable, specifying the conditions necessary for automatically re-engaging the player's underlying audio engine.
Because the Auto Disengage extension could cause the player's audio engine to become disengaged, as a result of audio inactivity or the user clicking on a link to a media file that is known (see the Music.addMediaFileExtensions static method), there needs to be some mechanism for eventually re-engaging the audio engine - otherwise the Beatnik-sonified content could be rendered permanently mute while the user continues to browse the sonified site.
In most cases, when the audio engine has been disengaged as a result of audio inactivity, it may be appropriate for the engine to re-engage once again when audio activity commences. In some cases, however, where the audio engine has been disengaged as a result of the user clicking on a link to a media file that is known by the Auto Disengage extension, it may not be appropriate for the audio engine to re-engage while the other media player window is still focused and the browser window containing the Beatnik-sonified content is behind it. In such cases, it may only be appropriate for the audio engine to attempt re-engaging if the Beatnik-sonified content is focused.
Three different auto engage modes are supported...
When the Music.autoEngageMode property is set to the value "always", the Auto Disengage extension will attempt to re-engage the audio engine whenever a Music Object instance becomes audible (ie. the value of its audible property becomes true after having previously been false). An instance could become audible if it is started playing after having been in a stopped or paused state, or, in the case of instances where the usage property is set to the value "notes", a musical note is played through the instance.
When the Music.autoEngageMode property is set to the value "when focused", the Auto Disengage extension will only attempt to re-engage the audio engine when a Music Object instance becomes audible and the window containing the sonified content is focused.
When the Music.autoEngageMode property is set to the value "never", the Auto Disengage extension will never attempt to re-engage the audio engine. This affords you the option of implementing your own custom re-engage behaviors.
| Music.mediaLinkInterception |
|
The Music.mediaLinkInterception static property is a boolean variable, specifying whether or not links to known types of media files should be intercepted in order to initiate the auto disengage process.
If the Music.mediaLinkInterception property is set to false at the time that the document completes loading in, then links to media files will not be intercepted, and the values of the Music.mediaLinkShutoutTime and Music.mediaLinksNoOnClicks static properties will have no effect on the behavior of the document.
If, on the other hand, the Music.mediaLinkInterception property is set to true at the time that the document completes loading in, and the user's system is not capable of mixing audio from multiple applications, and the document is not being browsed in Netscape 6 or the Music.mediaLinksNoOnClicks static property is set to true, then all links to media file types that are known by the Auto Disengage extension (see the Music.addMediaFileExtensions static method) will have interceptors added to them, so that the auto disengage process can be initiated when the user clicks on these links.
| Music.mediaLinkShutoutTime |
|
The Music.mediaLinkShutoutTime static property is an integer variable, specifying for how long (measured in milliseconds) the auto engage mechanism should be temporarily disabled, after the auto disengage process has been initiated from an intercepted media file link.
On systems that cannot mix audio from multiple applications, the purpose behind the Auto Disengage extension's interception of media file links is to give other media players the opportunity to use the system's audio device by initiating the auto disengage process and forcing the Beatnik Player's underlying audio engine to relinquish the audio device. Because it may sometimes take certain media player applications several seconds to load up and start playing the file that is being linked to, the shutout mechanism provides a way to protect against the auto engage mechanism (see the Music.autoEngageMode static property) re-engaging the audio engine while the media player is still loading (which could, otherwise, prevent it from being able to use the audio device).
So, when a link to a type of media file that is known by the Auto Disengage extension (see the Music.addMediaFileExtensions static method) is intercepted and the auto disengage process is initiated, then it will not be possible for the auto engage process to occur for at least the amount of time specified by the Music.mediaLinkShutoutTime property.
| Music.mediaLinksNoOnClicks |
|
The Music.mediaLinksNoOnClicks static property is a boolean variable, specifying if the links to media file types that are known by the Auto Disengage extension have no manually code ONCLICK event handlers.
The default value of this property is false, and the property should only be set to true if it is known for certain that none of the links to media files that could be intercepted by the Auto Disengage extension have pre-existing ONCLICK event handlers in the HTML code.
The Music.mediaLinksNoOnClicks property exists purely because of a bug in Netscape 6. With the initial release of Netscape 6, it was discovered that this browser had a significant issue that could cause the automatic attachment of handlers to HTML elements, using JavaScript, to interfere with other aspects of the proper functioning of HTML pages. The Auto Disengage extension achieves its interception of links to media files by attaching handlers to the ONCLICK events of links to any media file types that it knows about (see the Music.addMediaFileExtensions static method).
The value of this property will be used to determine whether or not event handlers can be automatically attached to HTML elements in order to intercept media file links, if the user is browsing with Netscape 6. If the user is browsing with Netscape 6 and this property is set to false, then media file links will not be intercepted, regardless of the value of the Music.mediaLinkInterception static property, or any other of the Auto Disengage extension's properties.